#include "DEntity.h"
using namespace std;

/*****************************************************************
 *
 *
 *
 *****************************************************************/
DEntity::DEntity()
{
	m_name = "unknown";
	m_parent = static_cast<DEntity *const>(0);
	m_entityType = DConstants::ET_BASICENTITY;
}

/*****************************************************************
 *
 *
 *
 *****************************************************************/
DEntity::DEntity( const DEntity &d )
{
	m_name = d.m_name;
	m_parent = d.m_parent;
	m_entityType = d.m_entityType;
}

/*****************************************************************
 *
 *
 *
 *****************************************************************/
DEntity::DEntity( const char* name )
{
	if( name )
		m_name = name;
	else
		m_name = "unknown";
	
	m_parent = static_cast<DEntity *const>( 0 );
	m_entityType = DConstants::ET_BASICENTITY;
}

/*****************************************************************
 *
 *
 *
 *****************************************************************/
DEntity::DEntity( DConstants::EntityType entityType )
{
	m_entityType = entityType;
	m_name = "unknown";
	m_parent = static_cast<DEntity *const>( 0 );
}

/*****************************************************************
 *
 *
 *
 *****************************************************************/
DEntity::DEntity(  const char* name, DConstants::EntityType entityType )
{
	if( name )
		m_name = name;
	else
		m_name = "unknown";
	
	m_entityType = entityType;
	m_parent = static_cast<DEntity *const>( 0 );
}


/*****************************************************************
 *
 *
 *
 *****************************************************************/
DEntity::~DEntity()
{
	


}

/*****************************************************************
 *
 *
 *
 *****************************************************************/
void DEntity::setName( const char *name ) 
{
	if( name )
		m_name = name;
	else
		m_name = "";
}


/*****************************************************************
 *
 *
 *
 *****************************************************************/
const char* DEntity::getName() const
{
	if( m_name.c_str() )
		return m_name.c_str();
	else
		return "";	
}


/*****************************************************************
 *
 *
 *
 *****************************************************************/
const DEntity& DEntity::operator=( const DEntity &rhs )
{
	m_name = rhs.m_name;
	m_parent = rhs.m_parent;
	m_entityType = rhs.m_entityType;
	return *this;
}
